home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1993 September / September 93.iso / Archives / Utilities / Analyse & Test / Test Utilities / RAM Utilities / MemINIT 2.0 / MemINIT 2.0.rsrc / TEXT_256.txt < prev    next >
Text File  |  1991-08-18  |  8KB  |  47 lines

  1. Compatibility:
  2.    MemINIT requires at least System 5.0 and a Macintosh 512KE.  Under systems before 6.0.5, you will have to restart for any changes in the control panel to take effect.  I know that the bar graph works OK in all color modes, including 32-bit, except 16-bit.  It should work in 16-bit (thousands of colors) but I haven‚Äôt had a chance to test it.  If anyone has any problems with it in 16-bit, please let me know.  I also don‚Äôt know how it will react to an accellerated video card.  If anyone has any problems with that, again, please let me know.  My address is at the bottom of this help text.  The pie graph should be OK with all video modes and cards.
  3.  
  4. The Function of MemINIT:
  5.    MemINIT 2.0 is a utility that displays the amount of memory that your Macintosh is using, and how much is free.  It either puts a 1-pixel high bar at the top of the menu bar, replaces the apple symbol with a pie graph, or both.  In both of these displays, the black (or darker colored) section is the amount of memory used, and the white (or lighter colored) section is the amout free.  Note that this is only the amount of memory used and free for the current application - it doesn‚Äôt include any memory used by the system, and if you are running MultiFinder or System 7, it only displays the amount of memory used and free for the frontmost program.  This means that MemINIT can NOT be used to judge how much memory is free to launch more programs.  It is more useful to judge if the current program should get more or less memory, by selecting get info for it in the Finder and entering a new value for the application memory size.
  6.  
  7. How to configure MemINIT:
  8.    MemINIT is both a startup document, meaning it loads itself into memory when your computer starts up, and a control panel document, which means that you can configure it through the control panel (or just by double-clicking on it in System 7).  Note that you must put in in your System Folder or Control Panels folder and reboot for it to take effect.
  9.    To configure MemINIT, click it‚Äôs name in the control panel, or in System 7 double click it‚Äôs icon.  Here are the controls and what they do:
  10.    ‚Ä¢ Help - brings up this help text.  But you obviously knew that‚Ķ
  11.    ‚Ä¢ Show Startup Icon - If this box is checked, then the MemINIT icon will appear at the bottom of the screen when it loads into memory during startup.  If there is an error during startup, the MemINIT icon with an X through it will appear, regardless of the setting of this check box.
  12.    ‚Ä¢ Bar Active - This box is checked if the bar graph is active.  The bar graph must be active before you can change any of its settings.  Here are what they do:
  13.       ‚Ä¢ Update time - This value is how often the bar redraws itself.  If the value is too small, the computer may slow down a small amount, and the bar may flicker when the cursor is moved.  If the value is too large, the bar isn‚Äôt updated often.  My favorite setting for this is 1/4 second.
  14.       ‚Ä¢ Tick mark spacing - This value is how much memory the black tick marks should represent.  What you want to set it to probably depends on how much memory you have and whether you usually use MultiFinder or System 7.  If you keep clicking the down arrow, the value will go to ‚ÄúNone,‚Äù in which case there are no tick marks.
  15.       ‚Ä¢ Bar color - This is the color that the bar will be.  Click the color sample to change it (this doesn‚Äôt work on black and white Macs).  Note that the bar color you actually see may be different from the chosen one in 4 or 16 colors, because of the limited number of colors.
  16.    ‚Ä¢ Pie Active - If this box is checked then the pie graph is active.  The pie graph must be active before you can change any of its settings.  Here are what they do:
  17.       ‚Ä¢ Update time - This control operates like the corresponding bar graph control.  The times are longer because the pie graph cannot be updated as often.
  18.       ‚Ä¢ Pie color and pan color - These controls act like the bar color control.  The pie color is the color of the ‚Äúslice‚Äù of pie - the memory used, and the pan color is the color of the ‚Äúpan‚Äù underneath the pie - the memory free.
  19.  
  20. Technical stuff:
  21.    The code installed to draw the graphs communicates with the control panel through what‚Äôs called gestalt.  Gestalt is only present in system 6.0.5 and later - in earlier systems you must restart after you have changed any options in the control panel for them to take effect.
  22.    The bar graph and the pie graph are updated in different ways.  The bar graph is what‚Äôs called a VBL task - meaning a Vertical BLanking task.  The image on your monitor is formed by an electron beam that sweeps across the screen for every row, and then back to the top of the screen, redrawing the entire screen every 60th of a second (75th of a second on some monitors).  While the electron beam is making it‚Äôs way back to the top of the screen, VBL tasks get a chance to execute.  During this time, MemINIT draws the bar graph.  VBL tasks execute no matter what, even when a menu is pulled down or a button is being pressed.  Therefore, the bar graph is updated while these things are happening.  The drawing of the cursor is also a VBL task, and therefore while the mouse is moving the bar graph may not get its time soon enough and may flicker.  Unfortunately, becuase VBL tasks can be executed at any time, they can‚Äôt rely on many other parts of the computer (such as QuickDraw).  Therefore, MemINIT must draw directly to the screen.  This is a tricky process, and I may have done something wrong that will make it crash on some computers.  I‚Äôm not sure how an accelerated video card may interact with it - it may not look very good, but it shouldn‚Äôt cause any problems.  Also, because it writes directly to the screen, if the cursor is on top of it, the cursor will be overwritten.  Also, if the cursor is on top of it and then moved, an incorrect bar may show.  This will correct itself in a few moments.
  23.    The pie graph is a jGNEFilter.  GetNextEvent (or WaitNextEvent under MultiFinder or System 7) is a routine that gets input from the user.  Programs must call it periodically to check for key pressed, mouse clicks, etc.  a jGNEFilter gets a chance to look at that event and modify it.  The pie graph uses this feature, but doesn‚Äôt worry about the event - it just uses the time to draw itself.  Because it is not interrupting other parts of the system, it can use QuickDraw, and therefore should be very reliable.  It will not overwrite the cursor, but the cursor may flicker a little when it is over the pie graph.
  24.    For Techies: I install a VBL task, install a jGNEFilter that calls the old filter, and patch _DrawMenuBar (NOT a tail patch).  I install a Gestalt routine with selector ‚ÄòMemV‚Äô.  The code is installed in the system heap in a block that is about 1K in size.  The VBL task is still active when the graph in deactivated, but it is only called about once every 18 hours and does nothing.
  25.    If you want the code (the cdev code is in Pascal, the INIT code is in assembly), just send me a disk.  It is also on America Online.  There will (hopefully) be an article on it in MacTutor in the next few months (September-October 1991).
  26.  
  27. Credits:
  28.    Thanks to Symantec for their wonderful Pascal compiler and thanks to Patrick C. Beard and James W. Walker for their ShowIconFamily code.
  29.  
  30. The Legal stuff:
  31.    MemINIT 2.0 is not ShareWare; I am not asking for any money for it (of course, if you really want to‚Ķ).  However, it is not public domain.  It may not be distributed with any package that is charged for without my consent, unless the charge is just for duplication and handling (i.e. user groups).  If you make any changes and want to distibute a changed version, contact me.  Also contact me if you have any suggestions or bug reports.
  32.  
  33. Version History:
  34.    ‚Ä¢ MemINIT 0.98 - Very buggy, no control panel interface.
  35.    ‚Ä¢ MemINIT cdev 1.5.1 - Didn‚Äôt work correctly with color.
  36.    ‚Ä¢ MemINIT cdev 2.0 - Complete re-write.  Works well with color.
  37.  
  38. How to contact me:
  39.    I am ‚ÄòSethML‚Äô on America Online and ‚ÄòAccuLab‚Äô on AppleLink.
  40.    During the school year:
  41.       Seth LaForge
  42.       658 Wildcat Cny.
  43.       Berkeley, CA 94708
  44.    During the summer:
  45.       Seth LaForge
  46.       450 Redmond Rd.
  47.       Eureka, CA 95501